# URL configuration for the Murphy Task Manager
# Copyright (c) 2009 the murphy-tm team
#
# Based on the default Django urls.py file.
#
# This file and all the other files belonging to the MurphyTM project
# are distributed under the terms of the GNU General Public License v3.
# See the COPYING file for details.

from settings import STATIC_DOC_ROOT

from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Compatible with Django 1.0
    (r'^admin/(.*)', admin.site.root), 

    # Login e logout
    (r'^$|^login/$', 'django.contrib.auth.views.login', {'template_name' : 'login.html','redirect_field_name' : 'home/'}),
    (r'^logout/$', 'views.logout'),

    # Homepage
    (r'^home/$', 'django.views.generic.simple.direct_to_template', {'template' : 'home.html'}),

    # Static media (hackish, but it works)
    (r'^css/(?P<path>.*)$', 'django.views.static.serve', {'document_root': STATIC_DOC_ROOT + '/css/'}),
    (r'^js/(?P<path>.*)$', 'django.views.static.serve', {'document_root': STATIC_DOC_ROOT + '/js/'}),
    (r'^img/(?P<path>.*)$', 'django.views.static.serve', {'document_root': STATIC_DOC_ROOT + '/img/'}),
)
